    <div class="head"><h5 class="iList">Filter traces</h5></div>
     <form action="<?php echo url_for('directorylanguages/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" id="valid" class="mainForm" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
     	<div class="rowElem noborder">
     	<label for="name">User:</label>
     		<div class="formRight">
     		<select name="sl_users" id="sl_users" style="width:200px;">
     		<option value="">-All-</option>
    		<?php foreach ($users as $user){?>
    		<option value="<?php echo $user->getId()?>"><?php echo $user->getName()?></option>
     		<?php }?>
     		</select>
     		</div>
     		<div class="fix"></div>
     	</div>
     	
     	<div class="rowElem noborder">
     	<label for="name">Initial Date:</label>
     		<div class="formRight">
     		<span style="margin-right:20px;">
                  <input readonly="readonly" type="text" class="datepicker" id="initial_date" name="initial_date"  value="<?php echo date('m-d-Y')?>" style="width: 100px"/>
            </span>
			</div>
     		<div class="fix"></div>
     	</div>
     	
     	<div class="rowElem noborder">
     	<label for="name">End Date:</label>
     		<div class="formRight">
     		<span style="margin-right:20px;">
                  <input readonly="readonly" type="text" class="datepicker" id="end_date" name="end_date"  value="<?php echo date('m-d-Y')?>" style="width: 100px"/>
            </span>
			</div>
     		<div class="fix"></div>
     	</div>
     	     	
     	
     	<div class="fix"></div>
        <input type="button" value="Filter" class="greyishBtn submitForm" id="filter" />
   
        <div class="fix"></div>
     </form>
     
     
<script type="text/javascript">

$("#filter").click(function (event){
    submitForm();
})





$("form#valid").submit(function (event){
    event.preventDefault();
    submitForm();
})

function submitForm(){
    var str=$('form#valid').serialize();

    $.ajax({type: 'POST', url:'<?php echo url_for('user_actions_trace/filter')?>', script:true, cache:false, data:  str, 
    beforeSend: function(){
    	/*if (!validate()){
			return false;
        }*/
        },
            success: function(data) {
                 $('#table').html(data);
             } });
}


function validate(){
	var valid = true;
	var error_msg = "";
	if ($("#language_name").attr("value") == ""){
		valid = false;
		error_msg = "Name required";
	}
	else if (valid && $("#language_culture").attr("value") == ""){
		valid = false;
		error_msg = "Culture required";
	}
		
	if (!valid){
		$('#msg_text').html(error_msg);
		$('#error_msg').show('fast');
	}
	return valid;			
}


		
		$('form').jqTransform({imgPath:'../images/forms'});
</script>     
